import http from '../utils/request';

interface Pages {
	tyjPageNum : number;
	tyjPageSize : number;
}

interface IndexStoreList extends Pages {
	distanceLimit : number,
	latitude : string;
	longitude : string;
	orderType : 0 | 1;
	serviceType : string
}

interface StoreDetail {
	latitude : string;
	longitude : string;
	storeId : string;
}


interface EditGoods {
	businessType ?: string;
	discountPrice ?: number | string;
	finalPrice ?: number;
	goodsId ?: string;
	serviceName ?: string;
	sort ?: number | string;
	price ?: number;
	status ?: string;
}



// 会员中心-商品详情
export function vipGoodsDetail(params : { goodsId : string }) : Promise<any> {
	return http('/api/auth/shopping/mall/goods/vipGoodsDetail', params)
}
// 会员中心-商品列表
export function vipGoodsList() : Promise<any> {
	return http('/api/auth/vip/goods/vipGoodsList')
}
// 机油详情
export function getOilDetail(params : { oilId : string, storeId : string }) : Promise<GetOilDetailRes> {
	return http('/api/unAuth/mer/store/goods/getOilDetail', params, 'POST') as any
}
// 分类门店产品列表
export function getStoreGoodsListByStoreId(params : { serviceType : string, storeId : string, serviceName ?: string }) : Promise<any> {
	return http('/api/unAuth/mer/store/goods/getStoreGoodsListByStoreId', params, 'POST')
}
// 首页门店服务
export function getIndexStoreList(params : IndexStoreList) : Promise<any> {
	return http('/api/unAuth/mer/store/getIndexStoreList', params, 'POST')
}
// 门店详情
export function getStoreDetail(params : StoreDetail) : Promise<any> {
	return http('/api/unAuth/mer/store/getStoreDetail', params, 'POST')
}

// 门店搜索
export function searchStoresByKeywords(params : { keywords : string, latitude ?: string, longitude ?: string, limit ?: number }) : Promise<any> {
	return http('/api/unAuth/mer/store/searchStoresByKeywords', params, 'POST')
}
// 门店管理--商品新增
export function addGoods(params : AddGoodsParams) : Promise<AddGoodsRes> {
	return http('/api/auth/mer/store/goods/addGoods', params, 'POST')
}
// 门店管理--商品修改
export function editGoods(params : EditGoods) : Promise<DefaultRes> {
	return http('/api/auth/mer/store/goods/editGoods', params, 'POST') as any
}

// 门店管理--商品状态修改
export function editGoodsStatus(params : EditGoodsStatusParams) : Promise<DefaultRes> {
	return http('/api/auth/mer/store/goods/editGoodsStatus', params, 'POST') as any
}


// 门店管理--获取商品详细
export function getMerGoodsById(params : { businessType : string, goodsId : string }) : Promise<GetMerGoodsByIdRes> {
	return http('/api/auth/mer/store/goods/getMerGoodsById', params)
}

// 查询商家系统订单评论信息列表
export function apiListMerOrderComment(params : ApiListMerOrderCommentParams) : Promise<ApiListMerOrderCommentRes> {
	return http('/api/auth/mer/goods/order/comment/apiListMerOrderComment', params, 'POST') as any
}
// 门店管理--获取快捷商品名称
export function getQuickGoodsName(params : GetQuickGoodsNameParams) : Promise<GetQuickGoodsNameRes> {
	return http('/api/auth/mer/store/goods/getQuickGoodsName', params, 'POST') as any
}